%% Katarakis Dimitrios 
%%AEM :961



%SELIDES 33-35
%%Askisi 1
% Ena dianysma b to opoio einai orthogonio einai to [4 -6 -2]
% ka8ws to eswteriko ginomeno me to a einai 0

a = [2 1 1]';
b = [-1 1 1];
eg = b*a

%To b omos dn einai monadiko.yparxoun polla akomi or8ogwnia dianysmata 
%poy tha mporousan na einai stin 8esi tou b 
%opos to [1 -1 -1] to [1 -2 0] etc...

%Askisi 2 
%Gia na synexizei to systhma na einai or8ogwnio prepei ola ta dianysmata 
% epipleon pou tha pros8etoyme na exoun eg =0 me opoiadipote allo 
%hdh yparxon dianisma.. Opote dn mporoume na pros8esoume perisotera
%dianismata apo oti oi diastaseis stis opoies douleyoume.ara edo to orio
%mas einai ta 3 dianismata


a = [2 1 1]'; 
b = [-1 1 1]'; 
f = cross(a,b); 
figure(1); 
clf;
drawVector([a b f], 'r.', {'a','b','f'}); 
view(-160, 7)


%Askisi 3
%H sthles tou pinaka A apoteloun kata thn anaparastash tous tis diastaseis
%ths monadiaias sfairas mas .

A = [a b f];
X = sampleUnitSphere(3,200);
AX = A*X;
figure(1);
clf;
hold on; 
plot3( X(1,:), X(2,:), X(3,:),'b.');
view(-60,10) 
plot3(AX(1,:),AX(2,:),AX(3,:),'g.'); 
drawVector(A, 'r.')
hold off; 
axis square equal; 
grid on;
norm(A,2)









%SELIDES 42-43
%Askisi 1


A = [-2 3; -3 1 ];
X = sampleUnitSphere(2, 100);
AX = A*X; 
figure(1); 
clf;
hold on;
plot( X(1,:), X(2,:),'b.');
plot(AX(1,:),AX(2,:),'r.');
hold off 
axis square equal
B = [1 3; 1 1];
C = reshape(1:4,2,2)







